<template>
	<view class="qxlj_back4 contain">
		<!-- 中文版 -->
		<view class="park_item qxlj_back2" v-for="(item,index) in parkList" :key="index" @click="goDeatil(item,'CN')">
			<view class="right">
				<image :src="item.CoverImg" mode=""></image>
			</view>
			<view class="left">
				<view class="one">{{item.RouteName}}</view>
				<view class="two">景点数量：{{item.GuideRouteInfoList.length}}</view>
				<view class="three">预计耗时{{item.TimeConsuming}}小时(中文讲解)</view>
				<view class="km_box">行程距离:{{item.Distance}}KM</view>
			</view>
		</view>
		<!-- 英文版 -->
		<view class="park_item qxlj_back2" v-for="(item,index) in parkList" :key="index" @click="goDeatil(item,'EN')">
			<view class="right">
				<image :src="item.CoverImg" mode=""></image>
			</view>
			<view class="left">
				<view class="one">{{item.RouteName}}</view>
				<view class="two">景点数量：{{item.GuideRouteInfoList.length}}</view>
				<view class="three">预计耗时{{item.TimeConsuming}}小时(英文讲解)</view>
				<view class="km_box">行程距离:{{item.Distance}}KM</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {
		getArticleCategoryListYLLX,
	} from '@/api/qxlj.js';
	export default {
		data() {
			return {
				parkList: '',
			}
		},
		onLoad() {
			this.postData();
		},
		methods: {
			goDeatil(e,chese) {
				let type = JSON.stringify(e.GuideRouteInfoList)
				let data =  JSON.stringify(e)
				uni.navigateTo({
					url: '/pages/YangquanTour/tourRoute?type=' + type + '&data=' + data + '&chese=' + chese
				})
			},
			async postData(e) {
				uni.showLoading({});
				try {
					const {
						Data
					} = await getArticleCategoryListYLLX({
						SiteId: 3211
					});
					uni.hideLoading();
					console.log(Data)
					this.parkList = Data;
				} catch (e) {
					console.log(e)
					//TODO handle the exception
				}
			},
		}
	}
</script>

<style scoped lang="scss">
	.contain {
		width: 100%;
		min-height: 100vh;
		padding: 4%;
	}

	.park_item {
		width: 100%;
		height: 200rpx;
		border-radius: 2%;
		display: flex;
		justify-content: space-between;
		padding: 3% 2%;
		margin-top: 2%;

		.left {
			width: 65%;
			position: relative;

			.one {
				color: #1A1A1A;
				font-size: 30rpx;
				font-weight: bold;
			}

			.two {
				color: #999999;
				height: 60rpx;
				margin-top: 2%;
				font-size: 24rpx;
			}

			.three {
				font-size: 24rpx;
				color: #999999;
				margin-top: 4%;
			}

			.km_box {
				color: #498FFF;
				font-size: 20rpx;
				position: absolute;
				top: 1%;
				right: 0;
			}
		}

		.right {
			width: 30%;
			height: 100%;

			image {
				width: 100%;
				height: 100%;
			}
		}

	}
</style>